<template>
	<view>
		<view class="">
			<!-- <text @click="shengcheng">生成海报</text> -->
			<l-painter :board="poster" />
		</view>
	</view>
</template>

<script>
	// 注意：如果使用HBuilder引入, 需要引入 '@/js_sdk/u-draw-poster'
	import {
		useDrawPoster
	} from 'u-draw-poster'
	export default {
		data() {
			return {
				poster: {
					css: {
						width: '750rpx',
					},
					views: [{
						type: 'view',
						css: {
							background: '#f0f0f0',
							height: '1240rpx',
							 width: '870rpx',
							// border: '1px solid black',
							// backgroundSize: '100%',
							// backgroundRepeat: 'no-repeat'
							backgroundImage: 'url(https://s4.ax1x.com/2022/02/10/HtqKUI.png) no-repeat',
						},
						views: [
							{
							    type: 'text',
							    text: '登鹳雀楼\n白日依山尽，黄河入海流\n欲穷千里目，更上一层楼',
							    css: {
							        // 设置居中对齐
							        textAlign: 'center',
									marginTop:'100rpx'
							        // 设置中划线
							        // textDecoration: 'line-through'
							    }
							}
							// {
							// 	type: 'image',
							// 	src: 'https://s4.ax1x.com/2022/02/10/HtqKUI.png',
							// 	css: {
							// 		width: '800rpx',
							// 		height: '1240rpx'
							// 	}
							// },
							// {
							// 	type: 'view',
							// 	css: {
							// 		background: '#bfbfbf',
							// 		width: '66.66%',
							// 		height: '100rpx',
							// 		display: 'inline-block'
							// 	}
							// }
						],

					}]
				}
			}
		},
		async onReady() {

		},
		methods: {
			shengcheng() {
				this.$refs.hchPoster.posterShow()
			},
			previewImage(base64) {
				uni.previewImage({
					urls: [base64]
				})
			}
		},
		onLoad() {
			this.$refs.hchPoster.posterShow()
		},
	}
</script>

<style lang="scss">
	.a {}
</style>
